package com.org.javabody.lambda.Map;

import java.util.Arrays;
import java.util.List;
/**
 * Created by Administrator on 2017-01-18.
 */
public class MapCaculate {
    public static void main(String[] args) {
        List<Integer> costBeforeTax = Arrays.asList(100, 200, 300, 400, 500);
        for (Integer cost : costBeforeTax) {
            double price = cost + 0.12*cost;
            System.out.println(price);
        }

        // With Lambda expression:
        costBeforeTax = Arrays.asList(100, 200, 300, 400, 500);
        costBeforeTax.stream().map((cost) -> cost + 0.12*cost)
                .forEach(System.out::println);
    }
}
